<template>
	<view class="layout">
		<!-- 主体区域 -->
		<view class="navbar">
			<view class="statusBar" :style="{height:getstatusBarHeight()+'px'}"></view>
			<view class="titleBar" :style="{height:gitTitleBarHeight()+'px'}">
				<view class="title">
					{{title}}
				</view>
				<view class="search">
					<navigator url="/pages/search/search">
					   <uni-icons class="icon" type="search" size="20"></uni-icons>
					   <text class="text">搜索</text>
					</navigator>
				</view>
			</view>
		</view>
		<view class="fill" :style="{height:gatNavBarHeight()+'px'}">
			<!-- 填充区（高度等于状态栏高度+标题栏高度） -->
		</view>
	</view>
</template>

<script setup>
import {ref} from 'vue'
import {getstatusBarHeight,gitTitleBarHeight,gatNavBarHeight} from "@/utils/system.js"

// console.log(tt.getCustomButtonBoundingClientRect)
defineProps({
	title:{
		type:String,
		default:"壁纸"
	}
})
</script>

<style lang="scss" scoped> 
.layout{
	.navbar{
		position: fixed;
		top:0;
		left:0;
		width: 100%;
		z-index: 10;
		background:
		linear-gradient(to bottom,rgba(0,0,0,0),#fff 400rpx),
		linear-gradient(to right,#ff5e3a 20%,#f6e8c3);
		.statusBar{
			// border: 1px solid red;
		}
		.titleBar{
			display: flex;
			align-items: center;
			padding: 0 30rpx;
			// border:1px solid green;
			.title{
				font-size: 22px;
				font-weight: 700;
				color:$text-font-color-1;
			}
			.search{
				width: 220rpx;
				height: 56rpx;
				border-radius: 60rpx;
				background: rgba(255,255,255,0.4);
				border: 1px solid #fff;
				margin-left: 30rpx;
				color:#999;
				font-size: 28rpx;
				display: flex;
				align-items: center;
				.icon{
					margin-left: 5rpx;
				}
				.text{
					padding-left: 10rpx;
				}
				
			}
			
		}
	}
	.fill{
		
	}
}
</style>